import {reqSearchList} from '@/apis'

const state = {
    searchList: []
}
const getters = {
    attrsList(state) {
        return state.searchList.attrsList
    },
    goodsList(state) {
        return state.searchList.goodsList
    },
    trademarkList(state) {
        return state.searchList.trademarkList
    },
    totalPages(state) {
        return state.searchList.totalPages;
    },
}
const mutations = {
    SET_SEARCHLIST(state, {searchList}) {
        state.searchList = searchList
    }
}
const actions = {
    async getSearchList({commit}, searchParams) {
        const res = await reqSearchList(searchParams)
        commit('SET_SEARCHLIST', {searchList: res})
    }
}

export default {
    namespaced: true,
    state,
    getters,
    mutations,
    actions
}